package com.breeze.toolkit.util;

import android.content.Context;

/**
 * Created by john on 2016/8/23.
 */
public class ResUtil {
	private ResUtil() {}

	public static int getDrawableId(Context context, String name) {
		return context.getResources().getIdentifier(name, "drawable", context.getPackageName());
	}

	public static int getLayoutId(Context context, String name) {
		return context.getResources().getIdentifier(name, "layout", context.getPackageName());
	}

	public static int getViewId(Context context, String name) {
		return context.getResources().getIdentifier(name, "id", context.getPackageName());
	}

	public static int getStyleId(Context context, String name) {
		return context.getResources().getIdentifier(name, "style", context.getPackageName());
	}

	public static int getStringId(Context context, String name) {
		return context.getResources().getIdentifier(name, "string", context.getPackageName());
	}
}
